package se.cbb.lib;

public class Pillar {
	private String[] cells;
	
	public Pillar() {
		cells = new String[20];
		for(int i = 0; i < 20; i++)
			cells[i] = "-";
	}
	
	private int determinePosition(String value) { return Integer.parseInt(value.split("\\.")[0]); }
	
	public boolean setPillar(String value) {
		int pos = determinePosition(value);
		if(cells[pos].equals("-")) {
			cells[pos] = value;
			return true;
		}
		else
			return false;
	}
	
	public boolean isPresent(String value) {
		int pos = determinePosition(value);
		if(cells[pos].equals(value))
			return true;
		else
			return false;
	}

	public String[] getPillar() { return cells;	}
	

}
